package com.sypk.vo;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties({ "header" })
public class TVo extends BaseVo {
	/**
	 * 
	 */
	private static final long serialVersionUID = 5779903320362442240L;
	private Header header;
	private String status;
	private String message;
	private Object data;
	private String serverTime;

	public Header getHeader() {
		return header;
	}

	public TVo(Object data) {
		super();
		this.status = "0000";
		this.message = "success";
		this.data = data;
		this.serverTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
	}

	public TVo(String status, String message, Object data) {
		super();
		this.status = status;
		this.message = message;
		this.data = data;
		this.serverTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
	}

	public static TVo success(Object data) {
		return new TVo("0000", "success", data);
	}

	public static TVo fail(String status, String message, Object data) {
		return new TVo(status, message, data);
	}

	public void setHeader(Header header) {
		this.header = header;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public String getServerTime() {
		return serverTime;
	}

	public void setServerTime(String serverTime) {
		this.serverTime = serverTime;
	}

}
